package com.itheima.controller;

import com.itheima.pojo.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {
    @Autowired
    private Person person;

    @RequestMapping("/hello")
    public String showHello() {
        return "hello world";
    }

    @RequestMapping("/person")
    @ResponseBody
    public Person showPerson() {
        System.out.println(person);
        return person;
    }
}
